<?php include_once __DIR__.'/../inc/tie_head.html';?>
<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md8">
      <div class="fly-panel" style="margin-bottom: 0;">
      <div class="fly-panel-title fly-filter">
        <a href="<?=url('tie/lists',['type'=>'all','cid'=>$cid])?>" <?php if($type=='all'):?>class="layui-this"<?php endif;?>>综合</a>
        <span class="fly-mid"></span>
        <a href="<?=url('tie/lists',['type'=>'uncn','cid'=>$cid])?>" <?php if($type=='uncn'):?>class="layui-this"<?php endif;?>>未结</a>
        <span class="fly-mid"></span>
        <a href="<?=url('tie/lists',['type'=>'cn','cid'=>$cid])?>" <?php if($type=='cn'):?>class="layui-this"<?php endif;?>>已结</a>
        <span class="fly-mid"></span>
        <a href="<?=url('tie/lists',['type'=>'jh','cid'=>$cid])?>" <?php if($type=='jh'):?>class="layui-this"<?php endif;?>>精华</a>
      </div>

        <ul class="fly-list">
        <?php foreach($list as $v):?>
          <li>
            <a href="<?=url('user/index').'?id='.$v['user_id']?>" class="fly-avatar">
              <img src="<?=$v['pic']?$v['pic']:'/static/bbs/images/avatar/default.png';?>" alt="<?=$v['username']?>">
            </a>
            <h2>
              <a class="layui-badge"><?=$v['cat_title']?></a>
              <a href="<?=url('tie/detail').'?id='.$v['id']?>"><?=$v['title']?></a>
            </h2>
            <div class="fly-list-info">
              <a href="<?=url('user/index').'?id='.$v['id']?>" link>
                  <cite><?=$v['username']?></cite>
                <?php if($v['level']):?>
                <i class="layui-badge fly-badge-vip">VIP<?=$v['level']?></i>
                <?php endif;?>
              </a>
              <span><?=com_time_format($v['create_time'],'f');?></span>
              <?php if($v['score']):?>
              <span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻"><i class="iconfont icon-kiss"></i> <?=$v['score']?></span>
              <?php endif;?>
              <?php if( $v['is_cn']):?>
              <span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>
              <?php endif;?>
              <span class="fly-list-nums">
                <i class="iconfont icon-pinglun1" title="回答"></i> <?=$v['reply_count']?>
              </span>
            </div>
            <div class="fly-list-badge">
              <?php if( $v['is_zd']):?>
              <span class="layui-badge layui-bg-black">置顶</span>
              <?php endif;?>
              <?php if( $v['is_jh']):?>
              <span class="layui-badge layui-bg-red">精帖</span>
              <?php endif;?>
            </div>
          </li>
        <?php endforeach;?>
        </ul>
        <?php if(count($list)<1):?>
        <div class="fly-none">没有相关数据</div>
        <?php endif;?>
        <div style="text-align: center" id="page">

        </div>
      </div>
    </div>
    <div class="layui-col-md4">
        <?php include_once __DIR__.'/../inc/tie_hot.html';?>
    </div>
  </div>
</div>
<script type="text/javascript">
//分页
layui.use(['laypage'], function(){
    var laypage = layui.laypage;
    laypage.render({
      elem: 'page'
      ,count:<?=$page_count?>
      ,curr:<?=$page?>
      ,limit:20
      ,jump: function(obj,first){
        //首次不执行
        if(!first){
            var o = GetRequest();
                o.page = obj.curr;
                o.url  = '/tie/lists';
            window.location.href = createUrl(o);
        }
      }
    });
});
</script>
